/*
 ============================================================================
 Name		: DiskBrowser.h
 Author	  : Lenka Litvova
 Version	 : 1.0
 Copyright   : Copyright belongs to Lenka Litvova
 Description : CDiskBrowser declaration
 ============================================================================
 */

#ifndef DISKBROWSER_H
#define DISKBROWSER_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <f32file.h>

// CLASS DECLARATION

/**
 *  CDiskBrowser
 * 
 */
class CDiskBrowser : public CBase
	{
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CDiskBrowser();

	/**
	 * Two-phased constructor.
	 */
	static CDiskBrowser* NewL();

	/**
	 * Two-phased constructor.
	 */
	static CDiskBrowser* NewLC();

private:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CDiskBrowser();

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL();

public:
	TInt GetDirectoryAndFileList(const TDesC& aPath);
	TInt DirectoryCount();
	TInt FileCount();
	const TDesC& DirectoryName(TInt aDirListIndex);
	const TDesC& FileName(TInt aFileNameIndex);
	TBool IsDirectory(const TDesC& aPath);
		
private:
	RFs iFileServer;
	CDir* iFileList;
	CDir* iDirList;
	};

#endif // DISKBROWSER_H
